Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(docs): Update api-markdown-documenter and utilize new hierarchy options #23504

Conversation

Josmithr
Copy link
Contributor

@Josmithr Josmithr commented Jan 8, 2025

Update dev dependency on @fluid-tools/api-markdown-documenter and leverage new "hierarchy" capabilities to move "folder" item documents (packages and namespaces) into their folders, renamed to index.

E.g.,
File structure before:

| fluid-framework.md
| fluid-framework
    | foo.md
    | ...

After:

| fluid-framework
    | index.md
    | foo.md
    | ...

This makes the breadcrumbs and navigation drop-downs generated by docusaurus better match the intended hierarchy.

E.g.,

Namespace appearance in the nav before:
image

  • Note that there is a separate page and folder, and selecting the folder doesn't navigate to the page; it just functions as a drop-down.

Namespace appearance after:
image

Breadcrumb before:
image

  • Note that the parent folder isn't selectable, because Docusaurus doesn't understand that it's supposed to point to the document of the same name.

Breadcrumb after:
image

  • Note that the parent entry is now selectable (screenshot was taken with mouse hovering over item)

AB#24263

@github-actions github-actions bot added area: website public api change Changes to a public API base: main PRs targeted against main branch labels Jan 8, 2025
@github-actions github-actions bot removed the public api change Changes to a public API label Jan 23, 2025
docs/api
!docs/api/index.mdx
versioned_docs/*/api
!versioned_docs/*/api/index.mdx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted to exclude specific files, rather than blanket-excluding mdx files. This will let us (theoretically) move our API docs to mdx in the future.

@@ -6,13 +6,13 @@ sidebar_position: 10

{/* Note: these contents are new and should be reviewed. The current website's API docs landing page has no description about what the packages do / when to use them. It's not very useful. */}

To get started with the Fluid Framework, you'll want to take a dependency on our client library, [fluid-framework](./fluid-framework.md).
To get started with the Fluid Framework, you'll want to take a dependency on our client library, [fluid-framework](./fluid-framework/index.md).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to specify index here because we are expressing these links via file paths rather than routes. This is the recommended pattern.

@@ -5,7 +5,7 @@ sidebar_label: fluid-framework

# fluid-framework Package

The fluid-framework package bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client package (for example, [@fluidframework/azure-client](/docs/deployment/azure-fluid-relay) or [@fluidframework/tinylicious-client](/docs/testing/tinylicious)).
The fluid-framework package bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client package (for example, [@fluidframework/azure-client](../deployment/azure-fluid-relay) or [@fluidframework/tinylicious-client](../testing/tinylicious)).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relative paths are preferred

@Josmithr Josmithr marked this pull request as ready for review January 23, 2025 19:42
@Josmithr Josmithr requested review from alexvy86 and a team January 23, 2025 19:42
Comment on lines +83 to +85
[ApiItemKind.Model]: HierarchyKind.Document,
[ApiItemKind.Namespace]: HierarchyKind.Folder,
[ApiItemKind.Package]: HierarchyKind.Folder,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values are the defaults for their respective types, but since we override document naming policy for them, seems reasonable to add them here explicitly to make the relationship clear.

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did what I could looking at the lockfile but very hard to review in detail. The rest looks good 👍 .

@Josmithr
Copy link
Contributor Author

I did what I could looking at the lockfile but very hard to review in detail. The rest looks good 👍 .

@alexvy86 I hadn't even noticed the churn there. I need to do a better job of remembering to check the lockfile changes in my own PRs...

Did we recently update our lockfile versions elsewhere in the repo? These changes bumped the version from 6 to 9. I notice that the root lockfile is already on 9. Did we forget to update docs in some previous upgrade pass?

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> [email protected] ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> [email protected] serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> [email protected] check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  169324 links
    1609 destination URLs
    1841 URLs ignored
       0 warnings
       0 errors


@alexvy86
Copy link
Contributor

Did we recently update our lockfile versions elsewhere in the repo? These changes bumped the version from 6 to 9. I notice that the root lockfile is already on 9. Did we forget to update docs in some previous upgrade pass?

Yeah, since #23318 the whole repo is on pnpm 9 now which comes with the lockfile update. Seems like we missed updating the lockfile for docs in that PR though.

@Josmithr Josmithr merged commit 6076f48 into microsoft:main Jan 24, 2025
27 checks passed
@Josmithr Josmithr deleted the docs/update-api-markdown-documenter-for-hierarchy-fixes branch January 24, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: website base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants